package com.etc.controller;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class CalcController {

	@RequestMapping(value = "add")
	public String add(double num1, double num2, HttpServletRequest request) {
		double sum = num1 + num2;
		String result = (num1 + " + " + num2 + "=" + sum);
		request.setAttribute("result", result);
		return "result";
	}
}
